<%@page import="models.Blog"%>
<%@page import="models.AutoSite"%>
<%@page import="java.util.ArrayList"%>
<%@page import="java.net.URLEncoder"%>
<%
	ArrayList<AutoSite> sites = (ArrayList<AutoSite>) request.getAttribute("sites");
	Blog blog = (Blog) request.getAttribute("blog");
%>

<jsp:include page="/layouts/header.jsp">
	<jsp:param name="title" value="" />
	<jsp:param name="description" value="" />
	<jsp:param name="keywords" value="" />
	<jsp:param name="page" value="home" />
</jsp:include>

<div id="userform" class="clearafter">
	<h1>Get Auto Content</h1><hr/>
	<div class="submitlink">
		<form method="post" action="" name="submitlink">
			<p>
				
				<label> Sitemaps (<a href="javascript:void(0)" style="display: inline;" id="checkreg">Older Selector</a>) 
				&nbsp;<img alt="Question" src="/images/i-help.gif" class="question"/>
				<span class="note">
					Add Url of Site that you want to auto get Content.
				</span>
				<br /> <input class="input" type="text"
					name="sitemap" id="sitemap" value=""/> </label>
			</p>
			<p>
				<div style="border: 1px solid #CCC;margin-bottom: 10px;padding: 5px;max-height: 300px;overflow: auto;width: 96%;" id='showreg'></div>
			</p>
			<p>
				HTML <input class="input type" type="radio"
					name="type"  style="width: auto;"  value="html"/>&nbsp;&nbsp;&nbsp;&nbsp;
				RSS <input class="input type" type="radio"
					name="type"  style="width: auto;" value="rss" />
				&nbsp;<img alt="Question" src="/images/i-help.gif" class="question"/>
				<span class="note">
					Content contain Html or Rss. Best to choose Html.
				</span>	
					
			</p>
			<p>
				Nofollow <input class="input type" type="radio"
					name="typeLink"  style="width: auto;"  value="nofollow" />&nbsp;&nbsp;&nbsp;&nbsp;
				Follow <input class="input type" type="radio"
					name="typeLink"  style="width: auto;" value="dofollow" />
				&nbsp;<img alt="Question" src="/images/i-help.gif" class="question"/>
				<span class="note">
					Set link at your Blog is Nofollow if you choose Nofollow and too same for Follow
				</span>	
			</p>
			<p>
				Source : 
				Yes <input class="input type" type="radio"
					name="source"  style="width: auto;"  value="yes" <%=(request.getAttribute("source")!=null&&request.getAttribute("source").equals("yes"))?"checked=\"checked\"":""%> <%=request.getAttribute("source")==null?"checked=\"checked\"":"" %>/>&nbsp;&nbsp;&nbsp;&nbsp;
				No <input class="input type" type="radio"
					name="source"  style="width: auto;" value="no" <%=(request.getAttribute("source")!=null&&request.getAttribute("source").equals("yes"))?"checked=\"checked\"":""%>/>
				&nbsp;<img alt="Question" src="/images/i-help.gif" class="question"/>
				<span class="note">
					Display from Source by choose Yes and dont display from source by choose No
				</span>	
			</p>
			<p>
				
				<label> Selector of Title Link
				&nbsp;<img alt="Question" src="/images/i-help.gif" class="question"/>
				<span class="note">
					Choose Newest Article of Blog. Then, Input Selector format tag to get Title Link: "class" by "." + name of class - "id" by "#" + name of id . Example : http://abc.com/getSelector
				</span>
				<br /> <input class="input" type="text"
					name="reglink" id="reglink" value="<%=request.getAttribute("reglink")!=null?request.getAttribute("reglink"):""%>"/> </label>
			</p>
			<p>
				
				<label> Selector of Title
				&nbsp;<img alt="Question" src="/images/i-help.gif" class="question"/>
				<span class="note">
					Click to the tilte link to redirect details page that you chose Newest Article. Then, input Selector format tag to get Title.
				</span>
				<br /> <input class="input"
					type="text" name="regtitle" id="regtitle" value="<%=request.getAttribute("regtitle")!=null?request.getAttribute("regtitle"):""%>"/> </label>
			</p>
			<p>
				
				<label> Selector of Content
				&nbsp;<img alt="Question" src="/images/i-help.gif" class="question"/>
				<span class="note">
					Input Selector format tag to get Content of Newest Article.
				</span>
				<br /> <input class="input"
					type="text" name="regcontent" id="regcontent" value="<%=request.getAttribute("regcontent")!=null?request.getAttribute("regcontent"):""%>"/> </label>
			</p>
			<p>
				<label> Selector To Remove
				&nbsp;<img alt="Question" src="/images/i-help.gif" class="question"/>
				<span class="note">
					Input Selector format tag to remove a part of Content of Newest Article that you don't want. 
					
				</span>
				<br /> <input class="input"
					type="text" name="regremove" id="regremove" value="<%=request.getAttribute("regremove")!=null?request.getAttribute("regremove"):""%>"/> </label>
			</p>
			<p>
				<input type="submit" value="submit" />
			</p>
			<a href="javascript:void(0)" id="checklink">Preview Article</a> First, previewing your Article is ok before click Submit Button
		</form>
	</div>
	<div class="howdy">
		Howdy : <b>asdsafdfd</b> <br />
		BlogId: <b><%=blog.getBlogId() %></b> <br />
		Type : <b>fasdfsafd</b> <br />
		<a href="/get-content">Get Special Content</a> <br /> 
		<a href="/edit-profile">Edit profile</a> <br />
		<a href="/logout">Logout</a> <br /> 
		<br/>
		<strong>List link</strong>
		<div class="listlink">
			<ul>
				<% for (int i = 0; i < sites.size(); i++) { %>
					<li> - <a href="/view-link?siteId=<%=sites.get(i).getId()%>"><%=sites.get(i).getSite() %></a></li>
				<% } %>
			</ul>
		</div>
	</div>
	<div class="clearbreak"></div>
	<hr />
	<div class="checkresult">
		
		
	</div>
</div>

<script type="text/javascript" src="/js/add-site.js"></script>
<%@ include file='/layouts/footer.jsp'%>